from django.conf.urls import url

from .import views

from rest_framework.routers import  DefaultRouter
#自动生成路由
urlpatterns = [
    # url(r'^infos/$',views.AreaInfoView.as_view({"get":"list"})),
    # url(r'^infos/(?P<pk>\d+)$',views.AreaInfoView.as_view({"get":"retrieve"})),


]
#1创建DefaultRoute
router = DefaultRouter()
#2.注册视图集
router.register(r'infos',views.AreaInfoView,base_name="areas")

#3.添加到urlpatterns
urlpatterns += router.urls